package conan.util;

import java.util.*;

public class LogMaster
{
    private static LogMaster instance;
    private List <Log> list;
    private boolean consoleOutput = true;
    
    private LogMaster()
    {
        list = new LinkedList<Log>();
    }
    
    public static LogMaster getInstance()
    {
        if (null == instance)
        {
            instance = new LogMaster();
        }
        return instance;
    }
    
    protected void add(Log logInstance)
    {
        list.add(logInstance);
    }
    
    public int numberOfLogs()
    {
        return list.size();
    }
    
    protected void sendMsg(String message)
    {
        if (consoleOutput)
        {
            System.out.println(message);
        }
    }

    public void setConsoleOutput(boolean consoleOutput)
    {
        this.consoleOutput = consoleOutput;
    }

    public boolean isConsoleOutput()
    {
        return consoleOutput;
    }
}
